package restlike.demo.shoreditchairways

import im.mange.shoreditch.api.liftweb.ServiceHelper
import ServiceHelper._
import im.mange.shoreditch.api._
import im.mange.shoreditch.api.liftweb.ServiceHelper

//TODO: remove the word Probe from everywhere
object Reservations extends ServiceHelper(base = "reservations", version = "10001")(
  "reservation/confirmed/@pnr" check ReservationConfirmed
)

case class ReservationConfirmed(pnr: String) extends Check {
  override def run =
    if (DemoState.bookings.exists(_.ref == pnr)) success
    else failure(List("No reservation found for pnr: " + pnr))
}